<script setup lang="ts">
import {ref} from 'vue'
import type {TabsPaneContext} from 'element-plus'
import Login from "@/components/auth/Login.vue";
import Register from "@/components/auth/Register.vue";
import Copyright from "@/components/Copyright.vue";

const activeName = ref('first')

const handleClick = (tab: TabsPaneContext, event: Event) => {
  console.log(tab, event)
}
</script>

<template>
  <div class="auth-container">
    <div class="logo-title">
      <img src="@/assets/logo.svg" alt="logo" class="logo"/>
      <h1 class="title">修哒哒</h1>
    </div>
    <div class="slogan">每一颗螺丝的承诺——修哒哒，高端车主的首选养护平台</div>
    <div class="tabs">
      <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
        <el-tab-pane label="账号登录" name="first">
          <Login></Login>
        </el-tab-pane>
        <el-tab-pane label="用户注册" name="second">
          <Register></Register>
        </el-tab-pane>
      </el-tabs>
    </div>
    <Copyright></Copyright>
  </div>

</template>

<style scoped lang="less">
.auth-container {
  display: flex; /* 启用 Flex 布局 */
  flex-direction: column; /* 垂直排列子元素 */
  width: 100vw;
  height: 100vh;
  background: rgb(255, 255, 255);
  background: linear-gradient(45deg, rgba(255, 255, 255, 1) 58%, rgba(109, 225, 252, 0.5) 71%, rgba(255, 255, 255, 1) 95%);

  .logo-title {
    height: 60px;
    width: 172px;
    margin: 60px auto 0;
    .logo {
      float: left;
      margin-top: 5px;
      width: 50px;
    }

    .title {
      display: inline-block;
      height: 60px;
      margin-left: 20px;
      line-height: 60px;
      font-size: 34px;
      font-weight: bold;
      flood-color: #000;
    }
  }

  .slogan {
    display: block;
    margin-top: 12px;
    font-size: 14px;
    flood-color: #000;
    text-align: center;
  }

  .tabs {
    flex: 1;
    .demo-tabs > .el-tabs__content {
      padding: 32px;
      color: #6b778c;
      font-size: 32px;
      font-weight: 600;
    }

    .el-tabs {
      width: 320px;
      margin: 50px auto 0;
    }

    :deep(.el-tabs__item) {
      font-size: 16px;
      padding: 0;
      margin: 0 48px;
      align-items: normal;
    }
    /**
      tabs下划线高度
     */
    :deep(.el-tabs__active-bar){
      height: 3px !important;
    }
  }
}

</style>